(function(w){
    var myList = function(){
        this.init();
        this.evt();
        return this;
    },iscroll = {}, c,firstPage = true;
    myList.prototype = {
        init: function(){
            var userId = getQueryString("userId"),
                lotteryId = getQueryString("lotteryId");
            c = this;

            this.data = {"url":cw.serverUrl+"/rest/v1.0/lottery/myLuckyRecord/"+userId+"/"+lotteryId+"/1",native: false};
            netWork(this.data,this.initData);
            iscroll = new cw.Scroll({id:"list",url:cw.serverUrl+"/rest/v1.0/lottery/myLuckyRecord/"+userId+"/"+lotteryId,method: c.initData});
        },
        initData: function(data){
            var html = "",date;
            if(data.data.length == 0){
                if(firstPage){
                    $("#pull_up_label").text("还没抽奖呢！赶紧试试手气吧！");
                    return;
                }
                $("#pull_up_label").text("没有更多数据了！");
                iscroll.noPage = true;
                return;
            }
            data.data.forEach(function(item){
                //date = new Date(item.time);
                html += "<li><span>"+formatTimeRule(item.time)+"</span><span class = 'reward'>"+item.prize+"</span></li>";
            });
            iscroll.add(html);
            iscroll.refresh();
            firstPage = false;
        },
        evt: function(){

        }
    };
    w.myList = myList;
}(window));
new myList();